package exercise;

/**
 * @ClassName PlainRect
 * @Deacription TODO
 * @Author 谢忠辉
 * @Date 2021/3/16 0016 11:28
 **/
public class PlainRect extends Rect{
    /**
     * 矩形左上角坐标
     */
    private int startX ;
    /**
     * 矩形左上角坐标
     */
    private int startY ;

    public PlainRect(){
        startX = 0 ;
        startY = 0 ;
    }
    public PlainRect(int startX , int startY , double height , double width){
        this.startX = startX ;
        this.startY = startY ;
        this.height = height ;
        this.width  = width ;
    }
    public void isInside(double x,double y){
        if (x>=startX&&x<=(startX+width)&&y<startY&&y>=(startY-height)){
            System.out.println("这个点在矩形内！");
        }else {
            System.out.println("这个点不在矩形内!");
        }
    }

}
